﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 发电机舱
{
    public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }
        public string Caption
        {
            get
            {
                //TODO
                return groupBox1.Text;
            }
            set
            {
                //TODO
                groupBox1.Text = value;
            }
        }
        public Font font
        {
            get
            {
                //TODO
                return groupBox1.Font;
            }
            set
            {
                //TODO
                groupBox1.Font = value;
            }
        }
        private void UserControl1_Load(object sender, EventArgs e)
        {

        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }

        private void groupBox1_Paint(object sender, PaintEventArgs e)
        {
            Pen pen=new Pen(Color.FromArgb(84, 114, 114), 5);
            e.Graphics.Clear(groupBox1.BackColor);
            e.Graphics.DrawString(groupBox1.Text, groupBox1.Font, Brushes.Black, 20, 0);
            e.Graphics.DrawLine(pen, 1, e.Graphics.MeasureString(groupBox1.Text, groupBox1.Font).Height / 2, 15, e.Graphics.MeasureString(groupBox1.Text, groupBox1.Font).Height / 2);
            e.Graphics.DrawLine(pen, e.Graphics.MeasureString(groupBox1.Text, groupBox1.Font).Width + 20, e.Graphics.MeasureString(groupBox1.Text, groupBox1.Font).Height / 2, groupBox1.Width - 2, e.Graphics.MeasureString(groupBox1.Text, groupBox1.Font).Height / 2);
            e.Graphics.DrawLine(pen, 1, e.Graphics.MeasureString(groupBox1.Text, groupBox1.Font).Height / 2, 1, groupBox1.Height - 2);
            e.Graphics.DrawLine(pen, 1, groupBox1.Height - 2, groupBox1.Width - 2, groupBox1.Height - 2);
            e.Graphics.DrawLine(pen, groupBox1.Width - 2, e.Graphics.MeasureString(groupBox1.Text, groupBox1.Font).Height / 2, groupBox1.Width - 2, groupBox1.Height - 2);
        }
    }
}
